<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>新增工单计划任务</title>
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <style type="text/css">
        .detail {
            padding-right: 20px!important;
        }

        h5 {
            color: #0062CC;
        }

        .mui-navigate-right .mui-col-xs-8 {
            width: 62.666667%!important;
        }

        .mui-text-right input,
        textarea {
            border: 0;
            font-size: 14px;
            font-weight: 400;
            color: #8f8f94;
            margin-bottom: 0;
            text-align: right;
        }

        textarea {
            text-align: left;
        }
    </style>
</head>

<body>
    <div class="mui-content">
        <ul class="mui-table-view mui-table-view-chevron type_list_spair">
            <li class="mui-table-view-cell detail">
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-4">
                        <h5 class="mui-ellipsis">序号：</h5>
                    </div>
                    <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                        <input type="number" placeholder="请输入序号" name="" id="tasksequence" value="" />
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell detail">
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-4">
                        <h5 class="mui-ellipsis">任务：</h5>
                    </div>
                    <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                        <input type="number" placeholder="请输入任务编号" name="" id="jptask" value="" />
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell detail">
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-4">
                        <h5 class="mui-ellipsis">摘要：</h5>
                    </div>
                </div>
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-8">
                        <textarea id="description" rows="6" placeholder="请填写摘要内容"></textarea>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell detail">
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-4">
                        <h5 class="mui-ellipsis">估计时长(Min)：</h5>
                    </div>
                    <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                        <input type="number" placeholder="请输入估计持续时间(Min)" name="" id="taskduration" value="" />
                    </div>
                </div>
            </li>
        </ul>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    var tasksequence = '',
        jptask = '',
        description = '',
        taskduration = '';
    apiready = function() {
        api.addEventListener({
            name: 'navitembtn'
        }, function(ret, err) {
            if (ret.index == 0) {
                tasksequence = $api.val($api.byId('tasksequence'));
                if (tasksequence == '') {
                    Toast('请输入序号！');
                    return
                }
                jptask = $api.val($api.byId('jptask'));
                if (jptask == '') {
                    Toast('请输入任务编号！');
                    return
                }
                description = $api.val($api.byId('description'));
                if (description == '') {
                    Toast('请填写摘要内容！');
                    return
                }
                taskduration = $api.val($api.byId('taskduration'));
                if (taskduration == '') {
                    Toast('请输入估计持续时间！');
                    return
                }
                ajaxrd("savePlanTask", {
                    tasksequence: $api.val($api.byId('tasksequence')),
                    jptask: $api.val($api.byId('jptask')),
                    description: $api.val($api.byId('description')),
                    taskduration: $api.val($api.byId('taskduration')),
                    wonum: api.pageParam.wonum
                }, function(ret, err) {
                    api.sendEvent({
                        name: 'refersh',
                        extra: {
                            isrefersh: 'yes'
                        }
                    });
                    Toast('新增成功！');
                    setTimeout(function() {
                        api.closeWin();
                    }, 500)
                })
            } else { //扫码

            }
        });
    }
</script>

</html>
